//
//  ZJReviewVC.m
//  这家测试项目
//
//  Created by IOS_DEVELOPER on 2017/7/7.
//  Copyright © 2017年 陈志凌. All rights reserved.
//

#import "ZJReviewVC.h"
#import "ZJMineController.h"
@interface ZJReviewVC ()
@property (weak, nonatomic) IBOutlet UILabel *typeTitle;

@end

@implementation ZJReviewVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.typeTitle.textColor = [Utils colorWithHexString:allConstHexColor];
    if ([allConstAuthenticated integerValue] != 2) {
        allConstAuthenticated = @"2";
        ZJUserModel * model = GET_USERINFO;
        model.authenticated = @"2";
        SYN_USER(model)
    }
    
    UIButton* backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [backButton setImage:[UIImage imageNamed:@"nav_icon_fh"]
                forState:UIControlStateNormal];
    backButton.frame = CGRectMake(0, 0, 20, 20);
    [backButton addTarget:self
                   action:@selector(backAction)
         forControlEvents:UIControlEventTouchUpInside];
    
    backButton.contentEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
    self.navigationItem.leftBarButtonItem =
    [[UIBarButtonItem alloc] initWithCustomView:backButton];

}

-(void)backAction{
    if (!self.isBackRoot) {
        for (UIViewController *controller in self.navigationController.viewControllers) {
            if ([controller isKindOfClass:[ZJMineController class]]) {
                [self.navigationController popToViewController:controller animated:YES];
            }
        }
    }else{
        [self.navigationController popToRootViewControllerAnimated:YES];
    }

}
@end
